package com.at.c05_stack;

/**
 * 操作数栈
 *
 * @author huangchao E-mail:fengquan8866@163.com
 * @version 创建时间：2024/6/23 21:15
 */
public class OperandStackTest {
    public void testAddOperation() {
        byte i = 15;
        int j = 8;
        int k = i + j;
    }

    public int getSum() {
        int m = 10;
        int n = 20;
        int k = m + n;
        return k;
    }

    public void testGetSum() {
        // 获取上一个栈帧返回的结果，并保存在操作数栈中
        int i = getSum();
        int j = 10;
    }

    /**
     * 面试题：常见的i++和++i的区别
     */
    public void add() {
        int i = 0;
        i++;
        ++i;
    }
}
